#pragma once
#include "afxwin.h"

#include"ListBoxEx.h"

class CVaxSIPUserAgent;

class CSettingDlg : public CPropertyPage
{
	DECLARE_DYNAMIC(CSettingDlg)

public:

	CSettingDlg(CVaxSIPUserAgent* pVaxSIPUserAgent);
	virtual ~CSettingDlg();

	enum { IDD = IDD_SETTING_DLG };

public:

	virtual BOOL OnApply();
	virtual BOOL OnInitDialog();

protected:

	virtual void DoDataExchange(CDataExchange* pDX);  
	DECLARE_MESSAGE_MAP()

public:

	void OnVaxInitialize();
	void OnVaxUnInitialize();

	void OnSuccessToConnect(int nLineNo, LPCTSTR sToRTPIP, int nToRTPPort);
	
private:

	void UpdateAudioIn();
	void UpdateAudioOut();
	void UpdateVideo();
		
	void UpdateCallQOS();
	void UpdateMediaQOS();

	void ActivateAudioCodecs();
	
	void ActivateVideoQuality();
	void ActivateVideoCodecs();
	
	void ActivateVoiceChanger();
	void ActivateOtherSettings();

	void ActivateQoS();
	void ActivateEncryptionTunnel();

public:

	BOOL m_bCheckGSM610;
	BOOL m_bCheckILBC;
	BOOL m_bCheckG729;
	BOOL m_bCheckG711A_LAW;
	BOOL m_bCheckG711U_LAW;
	BOOL m_bCheckEchoCancellation;
	BOOL m_bCheckAGC;
	BOOL m_bCheckMicBoost;
	BOOL m_bCheckDontDisturb;
	BOOL m_bCheckForceInbandDTMF;

	BOOL m_bCheckH263;
	BOOL m_bCheckH263P;

	int m_nRadioVCSelIndex;

	CListBoxEx m_ctrlListAudioIn;
	CListBoxEx m_ctrlListAudioOut;
	CListBox m_ctrlListVideo;

	CString m_sCryptTunnelIP;
	int m_nCryptTunnelPort;
	BOOL m_bCryptTunnelEnable;

private:

	CVaxSIPUserAgent* m_pVaxSIPUserAgent;
	CFont m_objFont;

private:

	CComboBox m_ctrlVideoQuality;

	CComboBox m_ctrlCallQoS;
	CComboBox m_ctrlMediaQoS;

public:

	afx_msg void OnRadioVCNormal_SelectionChanged();
	afx_msg void OnRadioVCGrandpa_SelectionChanged();
	afx_msg void OnRadioVCTeen_SelectionChanged();
	afx_msg void OnRadioVCHouseHold_SelectionChanged();
	afx_msg void OnRadioVChelium_SelectionChanged();
	afx_msg void OnRadioVCChipmunk_SelectionChanged();

	afx_msg void OnCheckCodecGsm610_CheckChanged();
	afx_msg void OnCheckCodecILBC_CheckChanged();
	afx_msg void OnCheckCodecG729_CheckChanged();
	afx_msg void OnCheckCodecG711A_CheckChanged();
	afx_msg void OnCheckCodecG711U_CheckChanged();
	afx_msg void OnCheckNoiseCancel_CheckChanged();
	afx_msg void OnCheckAGC_CheckChanged();
	afx_msg void OnCheckMICBoost_CheckChanged();
	afx_msg void OnCheckDontDisturb_CheckChanged();
	afx_msg void OnCheckForceInbandDTMF_CheckChanged();
	afx_msg void OnBnClickedCheckVideoCodecH263();
	afx_msg void OnBnClickedCheckVideoCodecH263p();

	afx_msg void On_SelChangeAudioIn();
	afx_msg void On_SelChangeAudioOut();
	afx_msg void On_SelChangeVideo();
	afx_msg void OnSelChangeComboVideoQuality();
	
	afx_msg void OnCbnSelchangeComboCallQos();
	afx_msg void OnCbnSelchangeComboMediaQos();
	
	
	afx_msg void OnBnClickedCheckTunnelEnable();
};


